/*
 * @Author: HeAo
 * @Date: 2021-11-03 15:06:26
 * @LastEditTime: 2021-11-03 15:50:20
 * @LastEditors: HeAo
 * @Description:
 * @FilePath: \web2103-2105\web2105\4-1-Nodejs\day04\app02\routes\user.js
 * 别乱动！
 */
const express = require('express');
// 1.创建路由实例
const router = express.Router();

// 2.构建路由
router.get('/findAll', (req, res) => {
  console.log(req.cookies);
  res.send({
    status: 20000,
    message: '查询成功',
    data: [
      { id: 1, name: 'tom' },
      { id: 2, name: 'larry' },
    ],
    timestamp: new Date().getTime()
  })
})

router.delete('/deleteById', (req, res) => {
  res.send('删除成功')
})

router.post('/saveOrUpdate', (req, res) => {
  res.send('保存或修改成功')
})

module.exports = router
